import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from "@/views/home/Home.vue"

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/classify',
    //利用函数懒加载
    component: () => import("@/views/classify/Classify.vue")
  },
  {
    path: '/car',
    component: () => import("@/views/car/Car.vue")
  },
  {
    path: '/my',
    component: () => import("@/views/my/My.vue")
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router